package com.itheima.day08.myHashSet.test1;

import java.util.HashSet;
import java.util.Iterator;

public class Test {
    public static void main(String[] args) {
        HashSet<String> hs = new HashSet<>();
        hs.add("Hello");
        hs.add("World");
        hs.add("Java");
        hs.add("Java");
        hs.add("Java");

        Iterator<String> it = hs.iterator();
        while(it.hasNext()){
            System.out.print(it.next() + " ");
        }
        System.out.println();
        System.out.println("=====================");

        for (String h : hs) {
            System.out.print(h + " ");
        }


    }
}
